﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Time.aspx.cs" Inherits="EnvironmentalMonitor.WebApplication.Environmental.Machine.Setup.Time" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <% = this.ReferencejQueryCss %>
    <% = this.ReferencejQueryJavascript %>
    <style type="text/css">
        html, body
        {
            margin: 0px;
            padding: 0px;
            height: 100%;
            overflow: hidden;
        }
        #dialog_form
        {
            margin: 0;
            padding: 10px 30px;
        }
        .form_title
        {
            font-size: 14px;
            font-weight: bold;
            color: #666;
            padding: 5px 0;
            margin-bottom: 10px;
            border-bottom: 1px solid #ccc;
        }
        .form_item
        {
            margin-bottom: 5px;
        }
        .form_item label
        {
            display: inline-block;
            width: 120px;
        }
        .form_input
        {
            width: 200px;
        }
    </style>
    <script type="text/javascript">
        var url = '<% = this.SaveJsonUrl %>';

        function saveModule() {
            var row = $('#list_data_grid').datagrid('getSelected');
            if (row) {
                if (row.Ip) {
                    $.ajax({
                        type: 'POST',
                        url: url,
                        data: { 'guid': row.Guid, 'ip': row.Ip },
                        success: function (data, textStatus, jqXHR) {
                            var result = eval('(' + data + ')');
                            $.messager.show({
                                title: '消息',
                                msg: result.msg
                            });
                            $('#list_data_grid').datagrid('reload');
                        }
                    });
                }
                else {
                    alert('请先设置IP！');
                }
            }
        };

        function initEditModule() {
        };

        function validateModule() {
            var result = true;

            return result;
        };
    </script>
</head>
<body>
    <div style="width: 100%; height: 100%">
        <table id="list_data_grid" title="<% = this.Description %>管理" class="easyui-datagrid"
            style="width: 100%; height: 100%" url="<% = this.ListJsonUrl %>" toolbar="#list_data_grid_toolbar"
            pagination="true" rownumbers="true" fitcolumns="true" singleselect="true" fit="true"
            pagelist="[<% = int.MaxValue %>]">
            <thead>
                <tr>
                    <th field="RoomName">
                        机房
                    </th>
                    <th field="Name">
                        名称
                    </th>
                </tr>
            </thead>
        </table>
        <div id="list_data_grid_toolbar">
            <a href="#" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="javascript:saveModule()">
                设置<% = this.Description %>时间</a>
        </div>
    </div>
</body>
</html>
